package com.wangyk.user.service.impl;

import com.wangyk.rabbitmqcommon.VO.ResultVO;
import com.wangyk.rabbitmqcommon.model.project.Category;
import com.wangyk.rabbitmqcommon.model.project.Order;
import com.wangyk.rabbitmqcommon.model.project.ProductInfo;
import com.wangyk.user.service.SleuthService;
import com.wangyk.user.thymeleafproject.service.CategoryService;
import com.wangyk.user.thymeleafproject.service.OrderService;
import com.wangyk.user.thymeleafproject.service.ProductInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class SleuthServiceImpl implements SleuthService
{
    @Resource
    private CategoryService categoryService;

    @Resource
    private ProductInfoService productInfoService;

    @Resource
    private OrderService orderService;

    @Override
    public ResultVO selectByPrimaryKey(Integer id)
    {
        ResultVO resultVO=new ResultVO();
        Category category = categoryService.selectByPrimaryKey(id);
        ProductInfo productInfo = productInfoService.selectByPrimaryKey(id);
        Order order = orderService.selectByPrimaryKey(id);
        resultVO.setData(category);
        return resultVO;
    }
}
